package com.ettractions.kiosk.commands
{
	import com.ettractions.kiosk.events.SelectCategoryEvent;
	import com.ettractions.kiosk.models.KioskModel;
	
	import org.robotlegs.mvcs.Command;

	public class SelectCategoryCommand extends Command
	{
		[Inject]
		public var event:SelectCategoryEvent
		
		[Inject]
		public var model:KioskModel;
		
		override public function execute():void
		{
			model.selectedBrochureIndex = event.category != null
			                            ? model.getCategoryFirstBrochureIndex(event.category)
			                            : -1;
		}
	}
}